#include "graph.h"
#include<bits/stdc++.h>
using namespace std;
int a[205][205],cnt=1,b[205][205];
vector<int>s[205];
void dfs(int fa){
	int now=Color();
	if(now==1){now=++cnt;}
	if(fa)s[fa].push_back(now),s[now].push_back(fa);
	int k=NumberOfRoads(),lat=LastRoad();
	if(fa)a[now][lat]=1;
	for(int i=1;i<=k;i++){
		if(a[now][i]) continue;
		a[now][i]=1;Move(i,now);dfs(now);
	}
	if(fa)Move(lat,now);
}
priority_queue<pair<int,int> >q;
int vis[20005];
void dfs1(int pp,int fa,int from){
	for(int i=1;i<=cnt;i++) vis[i]=0;
	q.push(make_pair(0,pp));
	while(q.size()){
		int p=q.top().second;
		q.pop();
		if(vis[p]) continue;vis[p]=1;
		for(int i=0;i<s[p].size();i++){
			int y=s[p][i];
			if(b[from][y]>b[from][p]+1){
				b[from][y]=b[from][p]+1;
				q.push(make_pair(-b[from][y],y));
			}
		}
	}
}
int ans[100005];
void Inspect(int R) {
	dfs(0);
	for(int i=1;i<=cnt;i++){
		for(int j=1;j<=cnt;j++){
			b[i][j]=1000000;
		}
	}
	for(int i=2;i<=cnt;i++){b[i][i]=0;dfs1(i,0,i);}
	int ma=0;
	for(int i=2;i<=cnt;i++){
		for(int j=i+1;j<=cnt;j++){
			ans[b[i][j]]++;
		}
	}
	for(int i=1;i<=R;i++){Answer(i,ans[i]);}
}
